//
//  NSDictionary+YCTools.h
//  YCCategory
//
//  Created by Apple on 2022/11/1.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDictionary (YCTools)

- (id)safeStringObjectForKey:(NSString *)key;

/// 转字符串
- (NSString *)dictionaryToString;

//转data
- (NSData *)dictionaryToData;

///合并两个字典
+ (NSDictionary *)dictionaryMergeWith:(NSDictionary *)dict1 and:(NSDictionary *)dict2;

///合并两个字典
- (NSDictionary *)dictionaryMergeWith:(NSDictionary *)dictionary;

/// json转字典
/// - Parameter json: json
+ (NSDictionary *)dictionaryWithJSON:(id)json;

- (BOOL)hasKey:(NSString *)key;

- (NSString *)stringForKey:(id)key;

- (NSNumber *)numberForKey:(id)key;

- (NSDecimalNumber *)decimalNumberForKey:(id)key;

- (NSArray *)arrayForKey:(id)key;

- (NSDictionary *)dictionaryForKey:(id)key;

- (NSInteger)integerForKey:(id)key;

- (NSUInteger)unsignedIntegerForKey:(id)key;

- (BOOL)boolForKey:(id)key;

- (int16_t)int16ForKey:(id)key;

- (int32_t)int32ForKey:(id)key;

- (int64_t)int64ForKey:(id)key;

- (char)charForKey:(id)key;

- (short)shortForKey:(id)key;

- (float)floatForKey:(id)key;

- (double)doubleForKey:(id)key;

- (long long)longLongForKey:(id)key;

- (unsigned long long)unsignedLongLongForKey:(id)key;

- (NSDate *)dateForKey:(id)key dateFormat:(NSString *)dateFormat;

- (CGFloat)CGFloatForKey:(id)key;

//- (CGPoint)pointForKey:(id)key;
//
//- (CGSize)sizeForKey:(id)key;
//
//- (CGRect)rectForKey:(id)key;

@end

NS_ASSUME_NONNULL_END
